﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<UserDetailsViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Edit user <em>
            <%= Model.UserName %></em></h2>
    <div>
        <% using (Html.BeginForm())
           { %>
        <%= Html.Hidden("userName") %>
        <table>
            <tr>
                <th>
                    User name
                </th>
                <td>
                    <%= Html.DisplayText("userName") %>
                </td>
            </tr>
            <tr>
                <th>
                    Email
                </th>
                <td>
                    <%= Html.TextBox("email") %>
                </td>
            </tr>
            <tr>
                <th>
                    Is approved
                </th>
                <td>
                    <%= Html.CheckBox("isApproved") %>
                </td>
            </tr>
            <tr>
                <th>
                    Roles
                </th>
                <td>
                    <%= Html.ListBox("roles") %>
                </td>
            </tr>
        </table>
        <input type="submit" value="Update user" />
    </div>
    <div>
        <h3>
            Change password</h3>
        <%} %>
        <% using (Html.BeginForm(new { action = "ChangePassword" }))
           { %>
        <%= Html.Hidden("userName")%>
        <table>
            <thead>
                <tr>
                    <th>
                        New password
                    </th>
                    <td>
                        <%= Html.Password("password") %>
                    </td>
                </tr>
            </thead>
        </table>
        <input type="submit" value="Change password" />
    </div>
    <div>
        <h3>
            Delete user</h3>
        <%} %>
        <% using (Html.BeginForm(new { action = "Delete" }))
           { %>
        <%= Html.Hidden("userName")%>
        <input type="submit" value="Delete user" />
        <%} %>
    </div>
</asp:Content>
